Current media status determination for a storage device

ABSTRACT

According to some embodiments, a current media status is determined for a storage device.

BACKGROUND

A storage device may store and/or retrieve information via removablemedia. For example, a Compact Disc (CD) drive reads information from aCD that can be inserted into or removed from the drive. The storagedevice may also transmit information to a host system (e.g., bytransmitting information to a motherboard via a serial interface). Insome cases, the host system may need to determine whether or not theremovable media is currently present in the storage device (e.g., toperform a certain action when a CD is inserted into a CD drive). Forexample, the host system may command the storage device to transitionfrom a lower-power state to a higher-power state when removable media isinserted. As another example, an Operating System (OS) or applicationexecuting at the host system might perform a task when removable mediais inserted (e.g., by automatically asking a user whether or notinformation on the media should be played).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a storage device and a host system.

FIG. 2 is a flow chart of a storage device method according to someembodiments.

FIG. 3 is a flow chart of a host system method according to someembodiments.

FIG. 4 is an example including a serial ATA interface according to someembodiments.

FIG. 5 is a flow chart of a serial ATA interface method according tosome embodiments.

FIG. 6 illustrates information flows for a device driver according tosome embodiments.

FIG. 7 is a block diagram of a system according to some embodiments.

DETAILED DESCRIPTION

A storage device may store and/or retrieve information via removablemedia. For example, a CD drive reads information from a CD and a DigitalVersatile Disc (DVD) drive reads information from a DVD. In some cases,a CD drive or a DVD drive can also store information onto a CD or a DVD.Similarly, a hard disk drive and a tape drive store and/or retrieveinformation via a removable hard disk and a magnetic tape, respectively.

FIG. 1 is a block diagram of a system 100 that includes a storage device110 and a host system 130. Note that the storage device 110 and hostsystem 130 might be separate devices or may be components of a singledevice, such as a Personal Computer (PC).

The storage device 110 may receive “removable” media (e.g., media thatis adapted to be inserted and/or removed by a user). The removable media120 may be, for example, a CD, a DVD, a removable hard disk, or amagnetic tape that can be inserted into or removed from the storagedevice 110 by a user. The host system 130 may be associated with, forexample, a PC, a mobile computer, a server, a workstation, or ahand-held device.

The storage device 110 may exchange information between the host system130 and the removable media 120. For example, the storage device 110 mayread information from the removable media 120 and provide theinformation to the host system 130. In some cases, the storage device110 may receive information from the host system 130 and store theinformation onto the removable media 120.

The storage device 110 and the host system may exchange information, forexample, via a serial interface such as a Serial Advanced TechnologyAttachment (ATA) interface as defined by the Serial ATA Working Groupspecification entitled “Serial ATA: High Speed Serialized AT Attachment”(January 2003).

In some cases, the host system 130 may need to determine whether or notthe removable media 120 is currently present in the storage device 110(e.g., to perform a certain action when a CD is inserted into a CDdrive). For example, the host system 130 may command the storage device110 to transition from a lower-power state to a higher-power state whenremovable media 120 is inserted.

To determine whether or not the removable media 120 is currently presentin (or at) the storage device 110, the host system 130 couldsynchronously poll the storage device 110. Such an approach, however,might prevent the storage device 110 and/or host system 130 (e.g., aprocessor or chipset associated with the host system 130) from enteringa lower-power state. For example, the storage device 110 might need toremain in a “standby” state as opposed to a lower-power “sleep” state inorder to respond to the polling. Similarly, the polling might requireDirect Memory Access (DMA) bus activity at the host system130—preventing a processor at the host system 130 from entering alower-power C3 or C4 power state as described in the AdvancedConfiguration and Power Interface (ACPI) Specification Revision 2.0b(October, 2002). As a result, the system 100 might consume a significantamount of power in order to determine whether or not the removable media120 is present (e.g., reducing the battery life of a mobile computersystem).

FIG. 2 is a flow chart of a storage device method according to someembodiments. The method may be performed, for example, by the storagedevice 110 of FIG. 1. The flow charts described herein do notnecessarily imply a fixed order to the actions, and embodiments may beperformed in any order that is practicable. Note that any of the methodsdescribed herein may be performed by hardware, software (includingmicrocode), or a combination of hardware and software. For example, astorage medium may store thereon instructions that when executed by amachine result in performance according to any of the embodimentsdescribed herein.

At 202, it is determined at a storage device that a current media statushas changed. For example, it might be determined that tape cartridge hasbeen inserted into or removed from the storage device.

At 204, an asynchronous message is transmitted to a host system as aresult of the determination. Moreover, the asynchronous message is amessage that could also be transmitted for a reason other than a currentmedia status change.

By way of example, the message could be a Serial ATA “Set Device Bits”packet that might also be used to provide error or status information tothe host system. In this case, an bit in the Set Device Bits packetmight be used as a notification bit (e.g., with 0 indicating that thepacket was sent for a reason other than a change in the current mediastatus and a 1 indicating that that the packet was sent because of achange in the current media status). Because an existing type ofasynchronous message is used, any changes required (e.g., firmware andsoftware changes) to support any of the embodiments described herein maybe limited.

In addition, the storage device may be able to perform the determinationand transmit the asynchronous message even when in a reduced powerstate. For example, a storage device might be able to perform thedetermination and transmit a Set Device Bits packet to a host systemeven when in sleep state or a lower-power state as defined by the“Advanced Configuration and Power Interface (ACPI) SpecificationRevision 2.0b” (October 2002).

FIG. 3 is a flow chart of a host system method according to someembodiments. The method may be performed, for example, by the hostsystem 130 of FIG. 1. At 302, the host system receives from a storagedevice an asynchronous message as a result of a current media statuschange, the asynchronous message being of a type that could also bereceived for a reason other than a current media status change.Moreover, as described with respect to FIG. 5, according to someembodiments the host system may arrange for a power state associatedwith the storage device to be adjusted as a result of the asynchronousmessage at 304 (e.g., by commanding or transitioning the storage deviceto a higher-power state when media is inserted).

As a result, it may be determined whether or not removable media iscurrently present in a storage device without needing to synchronouslypoll the storage device. Moreover, it might be possible for the storagedevice to be in a lower-power state when no media is present (e.g.,because the storage device does not need to respond to polling).Similarly, the host system might be able to determine the current mediastatus while in a lower-power state (e.g., because it does not need topoll the storage device).

FIG. 4 is an example of a system 400 that includes a serial ATAinterface according to some embodiments. The system 400 also includes astorage device 410 (e.g., a DVD drive)—and removable media 420 (e.g., aDVD) may be inserted into or removed from the storage device 410 by auser. In addition, a host system 430 (e.g., a PC or mobile computer) mayinclude a host processor 434, such as an INTEL® PENTIUM® 4 processor.The host processor 434 may, for example, execute an OS, one or more lowlevel device drivers, and/or one or more application programs.

According to this embodiment, the storage device 410 includes adetection unit (e.g., a hardware and/or software unit) to determinewhether or not the removable media is currently present (or simply todetermine if there is a change in the current removable media status).The storage device 410 may further include an interface unit 414 totransmit an asynchronous message to the host system 430 when there is achange in the current media status (e.g., when a DVD has been insertedinto or removed from the storage device 410). The asynchronous messagemay be, for example, a serial ATA Set Device Bits packet. Note that theserial ATA protocol allows for the storage device 410 to initiate thesending of a Set Device Bits packet to the host processor 430 (e.g.,even when there is no outstanding command). According to someembodiments, the detection unit 412 and the interface unit 414 canperform these functions even when the storage device 410 is in alower-power sleep state.

The host system 430 receives the asynchronous message at a host busadapter 432. The host bus adapter 432 may be, for example, located on amotherboard, integrated into a chipset, or a Peripheral ComponentInterconnect (PCI) device connected through a bus as defined in the PCIStandards Industry Group (SIG) standard entitled “Conventional PCI 2.2”or “PCI Express 1.0.”

According to some embodiments, the host bus adapter 432 updatesinformation in a register when the Set Device Bits packet is receivedfrom the storage device 410. Moreover, the packet may result in aninterrupt being generated to a device driver (e.g., a storage devicedriver) that is executing at the host processor 434. Because the storagedevice driver might receive interrupts for other reasons (e.g., when theSet Device Bits packet is sent for another reason), the storage devicedriver may examine information in the appropriate register whenever aninterrupt is received to determine if a change in the current mediastatus was the cause of a particular interrupt (e.g., by inspecting adedicated notification bit in the Set Device Bits packet).

Note that the asynchronous message received from the storage device 410might only indicate that the current media status has changed. That is,the message might not indicate whether the change was an insertion (orremoval) of the media 420. Thus, the storage device driver may transmita query to the storage device 410 and the storage device 410 may respondby indicating the current media status (e.g., that the removable media420 is currently present or absent). This information may then beprovided to the OS, and the OS might, for example, ask a user whether ornot content on the removable media 420 should be played at that time.

FIG. 5 is a flow chart of a serial ATA interface method according tosome embodiments. The method may be performed, for example, by the hostsystem 430 of FIG. 4. At 502, a Set Device Bits packet is received by ahost bus adapter which in turn updates a register (e.g., anSNotification register). The host bus adapter may also generate aninterrupt to a host processor at 504. A storage device driver executingat the host processor may then process the interrupt, such as byexecuting an Interrupt Service Routine (ISR).

If the storage device driver determines that a change in current mediastatus was the cause of the interrupt (e.g., based on one or more bitsin the register), the storage device driver transmits a query to thestorage device at 506 asking for the current media status. For example,the storage device driver might transmit a “Get Event StatusNotification” query to the storage device.

At 508, a response from the storage device indicates whether the currentmedia status change was because media has been (i) inserted into or (ii)removed from the storage device.

Note that a storage device might be associated with a number ofdifferent power states. For example, in a higher-power state the systemmight provide power via 3.3 Volt (V), 5 V, and 12 V paths or rails. Inthis case, the storage device could perform all of its normal functions(e.g., including opening a disk drawer and spinning a CD). On the otherhand, in a lower-power state the system might provide power only via the3.3 V path. In this case, the storage device may only perform a limitedset of functions (e.g., it might be able to detect a current mediastatus change and transmit a Set Device Bits packet to a host system butbe unable to open a disk drawer or spin a CD).

If it is determined that removable media has been inserted into thestorage device at 508, the OS may be notified (as described with respectto FIG. 6) and/or the storage device may be commanded to a higher-powerstate (e.g., standby) at 510. For example, the host system mighttransmit a command to the storage device instructing it to enter thehigher-power state. In some cases, the host system might directly adjustthe amount of power that is supplied to the storage device, such as viaField-Effect Transistors (FETs) in a mobile platform.

If it is determined that removable media has been removed from thestorage device at 508, the OS may be notified (as described with respectto FIG. 6) and/or the storage device may be commanded to a lower-powerstate (e.g., sleep) at 512. For example, power might be restored via the5 V and 12 V paths when removable media is inserted into the storagedevice. In this way, the host system may determine whether or notremovable media is currently present at a storage device and also reducethe amount of power that is used by the host system and/or storagedevice (e.g., to extend the battery life of a mobile computer).

Although a particular power scheme is illustrated in FIG. 5, embodimentsmay be associated with other types of power schemes. For example, astorage device might automatically enter a higher-power state (e.g.,“wake up”) when removable media is inserted. In this case, the storagedevice may simply notify the host system that the removable media hasbeen inserted (e.g., and the host system would not need to arrange forthe storage device to transition to the higher-power state).

FIG. 6 illustrates information flows 610, 620 for a device driveraccording to some embodiments. In a first approach 610, the OSsynchronously requests the current media status from the device driver(e.g., in the normal fashion). The device driver receives asynchronousnotifications from a storage device and tracks the current media status(e.g., by caching a flag that indicates whether or not the removablemedia is currently present). The device driver can then use thisintercepted information to respond to the synchronous poll request asappropriate. Note that is this case, an existing OS might not need to bemodified. In a second approach 620, the device driver receives anasynchronous notification from the storage device and simply passes thenotification on to the OS. Note that with the second approach 620, anexisting OS might need to be modified to support the receipt of anasynchronous notification from the device driver.

FIG. 7 is a block diagram of a system 700 that includes host system 730and disk drive 710 (e.g., a CD, DVD, or removable hard disk drive) intowhich a disk 720 may be inserted (or from which the disk 720 may beremoved) by a user. The disk drive 710 and/or the host system 730 mayoperate in accordance with any of the embodiments described herein.

For example, a host bus adapter 732 at the host system 730 may receivefrom the disk drive 710 an asynchronous message indicating that acurrent disk status has changed, the asynchronous message being of atype that could also be received for a reason other than a change in thecurrent disk status. Moreover, the host bus adapter 732 and/or a hostprocessor 734 may adjust the disk drive's power state as a result of themessage.

The following illustrates various additional embodiments. These do notconstitute a definition of all possible embodiments, and those skilledin the art will understand that many other embodiments are possible.Further, although the following embodiments are briefly described forclarity, those skilled in the art will understand how to make anychanges, if necessary, to the above description to accommodate these andother embodiments and applications.

Although particular types of removable media have been described,embodiments may be associated with other types of removable media (e.g.,a removable memory card). Moreover, although embodiments have beendescribed with respect to a single storage device, embodiments may beassociated with multiple storage devices (e.g., a host processor maymanage power states for both a CD drive and a DVD drive).

Similarly, although the asynchronous notification has been describedwith respect to a change in the current media status, according to otherembodiments the asynchronous notification may be used to provide otherinformation. For example, a storage device might transmit anasynchronous notification to a host system indicating that the storagedevice is overheating (e.g., so that the host system can takeappropriate action). As another example, a storage device may be in alower-power state when a user actives an eject button. In this case, thestorage device may notify a host system when the eject button isactivated so that the host system can arrange for the storage device totransition to a higher-power state (e.g., allowing the storage device toslide open a tray that accepts a CD).

The several embodiments described herein are solely for the purpose ofillustration. Persons skilled in the art will recognize from thisdescription other embodiments may be practiced with modifications andalterations limited only by the claims.

1. A method, comprising: determining at a storage device that a currentmedia status has changed; and transmitting an asynchronous message to ahost system as a result of the determination, wherein the asynchronousmessage can also be transmitted for a reason other than a current mediastatus change.
 2. The method of claim 1, wherein the asynchronousmessage is associated with a serial advanced technology attachmentinterface.
 3. The method of claim 2, wherein the asynchronous message isassociated with a set device bits packet.
 4. The method of claim 1,wherein the determining is performed while the storage device is in alower-power state.
 5. The method of claim 4, wherein the reduced powerstate is a sleep state.
 6. The method of claim 1, further comprising:receiving from the host system a command to adjust a power stateassociated with the storage device.
 7. The method of claim 1, furthercomprising: receiving from the host system a query for a current mediastatus; and transmitting to the host system an indication of the currentmedia status.
 8. The method of claim 7, wherein the current media statusindicates at least one of: (i) an absence of a removable storage media,and (ii) a presence of a removable storage media.
 9. The method of claim1, wherein the storage device comprises at least one of: (i) a compactdisc drive, (ii) a digital versatile disk drive, (iii) a tape drive, and(iv) a removable hard disk drive.
 10. An apparatus, comprising: adetection unit to determine a change in a current media status at astorage device; and an interface unit to transmit an asynchronousmessage to a host system as a result of the determination, wherein theasynchronous message can also be transmitted for a reason other than acurrent media status change.
 11. The apparatus of claim 10, wherein theinterface unit is a serial advanced technology attachment interface. 12.An apparatus, comprising: a storage medium having stored thereoninstructions that when executed by a machine result in the following:determining at a storage device that a current media status has changed,and transmitting an asynchronous message to a host system as a result ofthe determination, wherein the asynchronous message can also betransmitted for a reason other than a current media status change. 13.The apparatus of claim 12, wherein execution of the instructions furtherresults in: receiving from the host system a query for a current mediastatus, and transmitting to the host system an indication of the currentmedia status.
 14. The apparatus of claim 13, wherein the current mediastatus indicates at least one of: (i) an absence of a removable storagemedia, and (ii) a presence of a removable storage media.
 15. A method,comprising: receiving at a host system an asynchronous message from astorage device as a result of a current media status change, wherein theasynchronous message can also be received for a reason other than acurrent media status change; and arranging for a power state associatedwith the storage device to be adjusted as a result of the asynchronousmessage.
 16. The method of claim 15, further comprising: transmitting tothe storage device a query for a current media status; and receivingfrom the storage device an indication of the current media status. 17.The method of claim 15, wherein the arranging comprises: transmitting tothe storage device a command to adjust the power state.
 18. The methodof claim 15, wherein the asynchronous message is associated with aserial advanced technology attachment interface.
 19. The method of claim18, wherein the asynchronous message is associated with a set devicebits packet.
 20. The method of claim 19, further comprising: generatingan interrupt to a storage device driver in response to the asynchronousmessage.
 21. An apparatus, comprising: a storage medium having storedthereon instructions that when executed by a machine result in thefollowing: receiving at a host system an asynchronous message from astorage device as a result of a current media status change, wherein theasynchronous message can also be received for a reason other than acurrent media status change, and arranging for a power state associatedwith the storage device to be adjusted as a result of the asynchronousmessage.
 22. The apparatus of claim 21, wherein execution of theinstructions further results in: transmitting to the storage device aquery for a current media status, and receiving from the storage devicean indication of the current media status.
 23. The apparatus of claim22, wherein the current media status indicates at least one of: (i) anabsence of a removable storage media, and (ii) a presence of a removablestorage media.
 24. A system, comprising: a host processor; and a diskdrive, wherein the disk drive is to transmit asynchronous message to thehost processor indicating that a current disk status has changed,wherein the asynchronous message can also be transmitted for a reasonother than a change in the current disk status.
 25. The system of claim24, wherein a power state associated with the disk drive is adjusted asa result of the asynchronous message.
 26. A storage device drivermethod, comprising: receiving at a storage device driver an asynchronousnotification indicating that a current media status associated with astorage device has changed; determining a current media status inresponse to the received indication; and arranging for the current mediastatus to be provided to an operating system.
 27. The method of claim26, wherein said arranging comprises: caching the current media status;receiving a synchronous poll request from an operating system; andresponding to the synchronous poll request in accordance with the cachedcurrent media status.
 28. The method of claim 26, wherein said arrangingcomprises: passing an asynchronous indication of the current mediastatus to the operating system.
 29. A storage device driver apparatus,comprising: a storage medium having stored thereon instructions thatwhen executed by a machine result in the following: receiving at astorage device driver an asynchronous notification indicating that acurrent media status associated with a storage device has changed,determining a current media status in response to the receivedindication, and arranging for the current media status to be provided toan operating system.
 30. The apparatus of claim 29, wherein saidarranging comprises: caching the current media status, receiving asynchronous poll request from an operating system, and responding to thesynchronous poll request in accordance with the cached current mediastatus.
 31. The apparatus of claim 29, wherein said arranging comprises:passing an asynchronous indication of the current media status to theoperating system.
 32. An operating system method, comprising: receivingfrom a storage device driver an asynchronous indication of a currentmedia status associated with a storage device and removable media; andperforming an action in response to the asynchronous indication.
 33. Themethod of claim 32, wherein the action comprises determining whetherinformation stored on the removable media should be provided to a user.34. An operating system apparatus, comprising: a storage medium havingstored thereon instructions that when executed by a machine result inthe following: receiving from a storage device driver an asynchronousindication of a current media status associated with a storage deviceand removable media, and performing an action in response to theasynchronous indication.
 35. The apparatus of claim 34, wherein theaction comprises determining whether information stored on the removablemedia should be provided to a user.
 36. A method, comprising:determining at a storage device that an event has occurred; andtransmitting an asynchronous message to a host system as a result of thedetermination, wherein the asynchronous message can also be transmittedfor a reason other than an occurrence of the event.
 37. The method ofclaim 36, wherein the event is associated with at least one of: (i)activation of a button, and (ii) an overheating condition.